casper.test.begin('mobile page', 7, function suite(test){
	casper.start('../../mobile.html', function(){
		test.assertTitle("西邮导航 - 点亮你的生活！", "title is the one expected");
    	test.assertExists('form[action="http://lib.changxiaoyuan.com/"]', 'search form is found');
	})
	.then(function(){
		//five modules
		test.assertElementCount('.box', 5);
	})
	//panel change
	.thenClick('.other nav a:nth-child(1)', function(){
		test.assertVisible('.other ul:nth-child(2)');
	})
	.thenClick('.other nav a:nth-child(3)', function(){
		test.assertVisible('.other ul:nth-child(4)');
	})
	.thenClick('.other nav a:nth-child(4)', function(){
		test.assertVisible('.other ul:nth-child(5)');
	})
	.thenClick('.other nav a:nth-child(5)', function(){
		test.assertVisible('.other ul:nth-child(6)');
	})
	.then(function(){
		this.fill('form[action="http://lib.changxiaoyuan.com/"]', {
			'keyword' : 'javascript'
		}, true) //Immediately submit the form
	})
	.then(function(){
		this.echo(this.getTitle());
	})
	.run(function() {
        test.done();
        this.echo('So the whole suite ended.');  
    });
});